#APPENDIX F
#############################

#Marginal Means with Countries excluded
#NO AT
mm_no_at <- cj(No_AT, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                 Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_No_AT<-plot(mm_no_at, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.4, 0.6), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(axis.text.y = element_text(face = c('plain', 'plain','plain','bold',
                                            'plain', 'plain','bold',
                                            'plain', 'plain','plain','bold',
                                            'plain', 'plain','plain','bold',
                                            'plain', 'plain', 'bold',
                                            'plain', 'plain', 'plain','bold'))) + theme(legend.position="none")


#NO DE
mm_no_DE <- cj(No_DE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                 Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_No_DE<-plot(mm_no_DE, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.4, 0.6), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) + theme(legend.position="none")


#NO DK
mm_no_DK <- cj(No_DK, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                 Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_No_DK<-plot(mm_no_DK, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.4, 0.6), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) + theme(legend.position="none")

#NO ES
mm_no_ES <- cj(No_ES, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                 Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_No_ES<-plot(mm_no_ES, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.4, 0.6), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) + theme(legend.position="none")

#NO SE
mm_no_SE <- cj(No_SE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                 Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_No_SE<-plot(mm_no_SE, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.4, 0.6), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) + theme(legend.position="none")

#NO CH
mm_no_CH <- cj(No_CH, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                 Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_No_CH<-plot(mm_no_CH, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.4, 0.6), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) + theme(legend.position="none")

#mm for country interaction
mm_country <- cj(df1, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                   Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm", by = ~country)

#Plot
cj_country <-plot(mm_country,group = "country", vline = 0.5, size=3) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.39, 0.61), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Country")) + theme(legend.position="bottom")   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

#Split for dimensions
hlines_values2 <- c(3, 7, 11, 14, 18) 

#Plot
cj_country2 <-plot(mm_country,group = "country", vline = 0.5, size=3) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.39, 0.61), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + 
  theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Country")) + theme(legend.position="bottom")   +
  geom_hline(yintercept = hlines_values2, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x))) + 
  theme(axis.text.y = element_text(face = c('plain', 'plain','bold','plain', 'plain','bold', 'plain', 'plain', 'plain','bold')))

#Economic Dimension
cj_country2$data <- cj_country2$data[c(1:18, 34:51, 67:84, 100:117, 133:150, 166:183),]

#Cultural Dimension
cj_country_plot2b <- cj_country
cj_country_plot2b$data <- cj_country_plot2b$data[c(19:33, 52:66, 85:99, 118:132, 151:165, 184:198),]



################################################################################
#Country exclusive
#AT
mm_AT <- cj(AT, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_AT<-plot(mm_AT, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.4, 0.6), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) + theme(legend.position="none")

#Class_AT
mm_class_AT <- cj(AT, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                    Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm", by = ~oesch)

#Plot
cj_class_AT<-plot(mm_class_AT,group = "oesch", vline = 0.5, size=3) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Class")) + theme(legend.position="bottom") +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


cj_class_AT$data <- cj_class_AT$data[c(100:114, 133:147, 199:213, 115:132, 148:165, 214:231),]


#EDUC_AT
mm_educ_AT <- cj(AT, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                   Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~educ_2, estimate = "mm")

#Plot
cj1_AT_educ<-plot(mm_educ_AT, group = "educ_2", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.34, 0.66), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Educational Groups")) + theme(legend.position="bottom") +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


#Age_AT
mm_AT_age <- cj(AT, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                  Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~age_groups, estimate = "mm")

#Plot
cj1_AT_age<-plot(mm_AT_age, group = "age_groups", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.375, 0.625), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Age Groups")) + theme(legend.position="bottom")+ 
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


#CH
mm_CH <- cj(CH, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_CH<-plot(mm_CH, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  theme(legend.position = "None") + guides(fill = guide_legend(override.aes = list(color = NA)), shape = FALSE)  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


#Class_CH
mm_class_CH <- cj(CH, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
            Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm", by = ~oesch)

#Plot
cj_class_CH<-plot(mm_class_CH,group = "oesch", vline = 0.5, size=3) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Class")) + theme(legend.position="bottom")   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

cj_class_CH$data <- cj_class_CH$data[c(100:114, 133:147, 199:213, 115:132, 148:165, 214:231),]


#CH Education
mm_educ_CH <- cj(CH, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~educ_2, estimate = "mm")

#Plot
cj_CH_educ<-plot(mm_educ_CH, group = "educ_2", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Educational Groups")) + theme(legend.position="bottom")   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

#CH_age
mm_age_CH <- cj(CH, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~age_groups, estimate = "mm")

#Plot
cj_CH_age<-plot(mm_age_CH, group = "age_groups", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Age Groups")) + theme(legend.position="bottom")   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


#DE
mm_DE <- cj(DE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj_DE<-plot(mm_DE, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(fill = guide_legend(override.aes = list(color = NA)),shape = FALSE)  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


#class_DE
mm_class_DE <- cj(DE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
            Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm", by = ~oesch)

#Plot
cj_class_DE<-plot(mm_class_DE,group = "oesch", vline = 0.5, size=3) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Class")) + theme(legend.position="bottom")  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

cj_class_DE$data <- cj_class_DE$data[c(100:114, 133:147, 199:213, 115:132, 148:165, 214:231),]


#educ_DE
mm_educ_DE <- cj(DE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~educ_2, estimate = "mm")

#Plot
cj_DE_educ<-plot(mm_educ_DE, group = "educ_2", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Educational Groups")) + theme(legend.position="bottom")  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

#Age_DE
mm_age_DE <- cj(DE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~age_groups, estimate = "mm")

#Plot
cj_DE_age<-plot(mm_age_DE, group = "age_groups", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Age Groups")) + theme(legend.position="bottom")  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

#DK
mm_DK <- cj(DK, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_DK<-plot(mm_DK, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(fill = guide_legend(override.aes = list(color = NA)), color = FALSE, shape = FALSE)   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

#DK_class
mm_class_DK <- cj(DK, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
                    Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm", by = ~oesch)

#Plot
cj_class_DK<-plot(mm_class_DK,group = "oesch", vline = 0.5, size=3) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Class")) + theme(legend.position="bottom")  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


cj_class_2a <- cj_class
cj_class_2a$data <- cj_class_2a$data[c(100:114, 133:147, 199:213, 115:132, 148:165, 214:231),]


#DK_educ
mm_educ_DK <- cj(DK, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~educ_2, estimate = "mm")

#Plot
cj1_DK_educ<-plot(mm_educ_DK, group = "educ_2", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Educational Groups")) + theme(legend.position="bottom")  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


#DK_age
mm_age_DK <- cj(DK, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~age_groups, estimate = "mm")

#Plot
cj1_DK_age<-plot(mm_age_DK, group = "age_groups", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Age Groups")) + theme(legend.position="bottom")   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


#ES
mm_ES <- cj(ES, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_ES<-plot(mm_ES, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(fill = guide_legend(override.aes = list(color = NA)), color = FALSE, shape = FALSE)   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

#Class_ES
mm_class_ES <- cj(ES, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
            Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm", by = ~oesch)

#Plot
cj_class_ES<-plot(mm_class_ES,group = "oesch", vline = 0.5, size=3) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Class")) + theme(legend.position="bottom")  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

cj_class_ES$data <- cj_class_ES$data[c(100:114, 133:147, 199:213, 115:132, 148:165, 214:231),]


#ES_educ
mm_educ_ES <- cj(ES, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~educ_2, estimate = "mm")

#Plot
cj1_ES_educ<-plot(mm_educ_ES, group = "educ_2", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Educational Groups")) + theme(legend.position="bottom")  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

#age_ES
mm_age_ES <- cj(ES, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~age_groups, estimate = "mm")

#Plot
cj1_ES_age<-plot(mm_age_ES, group = "age_groups", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Age Groups")) + theme(legend.position="bottom")   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

#SWEDEN
mm_SE <- cj(SE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm")

#Plot
cj1_SE<-plot(mm_SE, vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(fill = guide_legend(override.aes = list(color = NA)),color = FALSE, shape = FALSE)   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

#class_SE
mm_class_SE <- cj(SE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
            Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, estimate = "mm", by = ~oesch)

#Plot
cj_class_SE<-plot(mm_class_SE,group = "oesch", vline = 0.5, size=3) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Class")) + theme(legend.position="bottom")  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 

cj_class_SE$data <- cj_class_SE$data[c(100:114, 133:147, 199:213, 115:132, 148:165, 214:231),]

#SE_educ
mm_educ_SE <- cj(SE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~educ_2, estimate = "mm")

#Plot
cj1_SE_educ<-plot(mm_educ_SE, group = "educ_2", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Educational Groups")) + theme(legend.position="bottom")  +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 


#age_SE
mm_age_SE <- cj(SE, choice ~ Immigration + Headscarf + Gender_quota + Ecology + Childcare +
              Early_retirement + Inheritance_tax + Job_protection + Housing,  id = ~respondentid, by = ~age_groups, estimate = "mm")

#Plot
cj1_SE_age<-plot(mm_age_SE, group = "age_groups", vline = 0.5, size=5) +
  geom_point(position = position_dodge(0.75)) +
  scale_x_continuous(limits = c(0.3, 0.7), breaks = c(0.3, 0.4, 0.5, 0.6, 0.7)) +
  theme_bw() + xlab("Marginal Means") + theme_minimal(base_size =
                                                        15) + theme(text=element_text(family="Garamond", size=22))+
  guides(color=guide_legend("Age Groups")) + theme(legend.position="bottom")   +
  geom_hline(yintercept = hlines_values, color = "black", linetype = "dashed") + 
  scale_y_discrete(labels = function(x) gsub("_", " ", gsub("\\(|\\)", "", x)))  +
  theme(text=element_text(face = c('plain', 'plain','plain','bold',
                                   'plain', 'plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain','plain','bold',
                                   'plain', 'plain', 'bold',
                                   'plain', 'plain', 'plain','bold'))) 